package main

import (
	"errors"
	"fmt"
)

func div(a, b int) (res int, err error) {
	if b == 0 {
		err = errors.New("除数不能为0") //返回异常
	} else {
		res = a / b
	}
	return
}

func main() {
	_, err := div(10, 0)
	fmt.Println(err)
}
